/*
 * @Descripttion: 
 * @Author: liuYaoYu
 * @Date: 2021-12-13 10:47:42
 * @LastEditors: liuYaoYu
 * @LastEditTime: 2021-12-13 10:59:42
 */
package main

import (
	"fmt"
	"strings"
)
func makesuffix(suffix string)func (string) string{
	return func ( name string ) string {
		if !strings.HasSuffix(name,suffix){
			return name+suffix
		}
		return name
	}
}
func main(){
	checkSuffix:=makesuffix(".jpg")
	fmt.Println(checkSuffix("task"))
	fmt.Println(checkSuffix("task.jpg"))
}